home *** CD-ROM | disk | FTP | other *** search
/ Material Dictionary 8 / Material Dictionary 8.iso / sozai.exe / sozai.DXR / 00121.ls < prev    next >
Encoding:
Text File  |  1996-01-05  |  5.6 KB  |  246 lines

  1. on startMovie
  2.   if the castType of cast 941 = #empty then
  3.     set msg to "├»K├│v├ç┬╗├ët├ë@├ëC├ë├ú├çΓäó├Ñ┬⌐├ç┬¼├ç┬⌐├ç├ï├çΓÇ╣├ç├╛├ç├Æ├àB" & RETURN & "CD-ROM├ç┬⌐├ç├ü├⌐┬┐├ºs├ç┬╡├ç╞Æ├ç┬ì├ç├ª├ç┼╜├ç┬ó├àB"
  4.     alert(msg)
  5.     go("End")
  6.   end if
  7. end
  8.  
  9. on setup
  10.   global pictsp, scrollthumbsp, scrolltop, scrollmax, firstv
  11.   set pictsp to 1
  12.   set scrollthumbsp to 12
  13.   set scrolltop to 0
  14.   set h to the height of cast the castNum of sprite pictsp
  15.   set scrollmax to integer((h / float(75 + 26)) + 0.5) - 4
  16.   set firstv to the locV of sprite pictsp
  17. end
  18.  
  19. on keyhandler
  20.   if not (the controlDown) then
  21.     dontPassEvent()
  22.   end if
  23.   if the controlDown and ((the key = "c") or (the key = "C")) then
  24.     set the text of cast "Selection" to the selection
  25.     copyToClipBoard(cast "Selection")
  26.     dontPassEvent()
  27.   end if
  28. end
  29.  
  30. on stopMovie
  31.   set the text of cast "FilePath" to " "
  32.   set the text of cast "Selection" to " "
  33. end
  34.  
  35. on m2w path
  36.   repeat with i = 1 to the maxinteger
  37.     set c to char i of path
  38.     if c = EMPTY then
  39.       exit repeat
  40.     end if
  41.     if c = ":" then
  42.       put "\" into char i of path
  43.     end if
  44.   end repeat
  45.   return path
  46. end
  47.  
  48. on w2m path
  49.   repeat with i = 1 to the maxinteger
  50.     set c to char i of path
  51.     if c = EMPTY then
  52.       exit repeat
  53.     end if
  54.     if c = "\" then
  55.       put ":" into char i of path
  56.     end if
  57.   end repeat
  58.   return path
  59. end
  60.  
  61. on scrolldown
  62.   global scrolltop, scrollmax
  63.   if (scrolltop - 1) < 0 then
  64.     exit
  65.   end if
  66.   set scrolltop to scrolltop - 1
  67.   updatethumb()
  68.   adjustselect(-1)
  69.   updatepict()
  70. end
  71.  
  72. on pagedown
  73.   global scrolltop, scrollmax
  74.   if scrolltop = 0 then
  75.     exit
  76.   end if
  77.   set tscrolltop to scrolltop - 4
  78.   if tscrolltop < 0 then
  79.     set tscrolltop to 0
  80.   end if
  81.   adjustselect(tscrolltop - scrolltop)
  82.   set scrolltop to tscrolltop
  83.   updatethumb()
  84.   indicate()
  85.   updatepict()
  86. end
  87.  
  88. on scrollup
  89.   global scrolltop, scrollmax
  90.   if (scrolltop + 1) > scrollmax then
  91.     exit
  92.   end if
  93.   set scrolltop to scrolltop + 1
  94.   updatethumb()
  95.   adjustselect(1)
  96.   updatepict()
  97. end
  98.  
  99. on pageup
  100.   global scrolltop, scrollmax
  101.   if scrolltop = scrollmax then
  102.     exit
  103.   end if
  104.   set tscrolltop to scrolltop + 4
  105.   if tscrolltop > scrollmax then
  106.     set tscrolltop to scrollmax
  107.   end if
  108.   adjustselect(tscrolltop - scrolltop)
  109.   set scrolltop to tscrolltop
  110.   updatethumb()
  111.   indicate()
  112.   updatepict()
  113. end
  114.  
  115. on adjustselect delta
  116.   set nv to the locV of sprite 19 - (delta * 101)
  117.   if (nv < 20) or (nv > 400) then
  118.     deselect()
  119.   else
  120.     set the locV of sprite 19 to nv
  121.   end if
  122. end
  123.  
  124. on updatethumb
  125.   global pictsp, scrollthumbsp, scrolltop, scrollmax
  126.   set basesp to scrollthumbsp - 1
  127.   set len to the height of sprite basesp - the height of sprite scrollthumbsp
  128.   set pos to scrolltop * len / scrollmax
  129.   set the locV of sprite scrollthumbsp to the locV of sprite basesp + pos
  130.   updateStage()
  131. end
  132.  
  133. on thumbpressed ov
  134.   global pictsp, scrollthumbsp, scrolltop, scrollmax
  135.   set cn to the castNum of sprite scrollthumbsp
  136.   set the castNum of sprite scrollthumbsp to cn + 1
  137.   set basesp to scrollthumbsp - 1
  138.   set h to the height of sprite scrollthumbsp
  139.   set lastv to the locV of sprite scrollthumbsp
  140.   set dv to the mouseV - ov
  141.   updateStage()
  142.   repeat while the stillDown
  143.     set nv to the mouseV - dv
  144.     if nv < the top of sprite basesp then
  145.       set nv to the top of sprite basesp
  146.     end if
  147.     if nv > (the bottom of sprite basesp - h) then
  148.       set nv to the bottom of sprite basesp - h
  149.     end if
  150.     if the mouseV < (the top of sprite basesp - 100) then
  151.       set nv to lastv
  152.     end if
  153.     if the mouseV > (the bottom of sprite basesp + 100) then
  154.       set nv to lastv
  155.     end if
  156.     if the mouseH < (the left of sprite basesp - 30) then
  157.       set nv to lastv
  158.     end if
  159.     if the mouseH > (the right of sprite basesp + 30) then
  160.       set nv to lastv
  161.     end if
  162.     set the locV of sprite scrollthumbsp to nv
  163.     updateStage()
  164.     indicate()
  165.   end repeat
  166.   deselect()
  167.   set scrolltop to thumbindex()
  168.   updatethumb()
  169.   indicateoff()
  170.   updatepict()
  171.   set the castNum of sprite scrollthumbsp to cn
  172.   updateStage()
  173. end
  174.  
  175. on deselect
  176.   set the text of cast "FilePath" to " "
  177.   set the selStart to 0
  178.   set the selEnd to 0
  179.   out(19)
  180.   updateStage()
  181. end
  182.  
  183. on indicate
  184.   set topone to (thumbindex() * 5) + 1
  185.   set the text of cast "Indicator" to topone & "-" & topone + 20 - 1
  186. end
  187.  
  188. on indicateoff
  189.   set the text of cast "Indicator" to " "
  190. end
  191.  
  192. on thumbindex
  193.   global pictsp, scrollthumbsp, scrolltop, scrollmax
  194.   set basesp to scrollthumbsp - 1
  195.   set len to the height of sprite basesp - the height of sprite scrollthumbsp
  196.   set pos to the locV of sprite scrollthumbsp - the locV of sprite basesp
  197.   return ((pos * scrollmax) + (len / 2)) / len
  198. end
  199.  
  200. on updatepict
  201.   global pictsp, firstv, scrolltop
  202.   startTimer()
  203.   set the locV of sprite pictsp to firstv - (scrolltop * 101)
  204.   updateStage()
  205.   if the optionDown then
  206.     exit
  207.   end if
  208.   repeat while the timer < 10
  209.     nothing()
  210.   end repeat
  211.   if the controlDown then
  212.     repeat while the timer < 15
  213.       nothing()
  214.     end repeat
  215.   end if
  216. end
  217.  
  218. on in sp
  219.   if the locH of sprite sp < 0 then
  220.     set the locH of sprite sp to the locH of sprite sp + 3000
  221.   end if
  222. end
  223.  
  224. on out sp
  225.   if the locH of sprite sp > 0 then
  226.     set the locH of sprite sp to the locH of sprite sp - 3000
  227.   end if
  228. end
  229.  
  230. on buttondown
  231.   set cn to the castNum of sprite the clickOn
  232.   set the castNum of sprite the clickOn to cn + 1
  233.   updateStage()
  234.   repeat while the stillDown
  235.     if rollOver(the clickOn) then
  236.       set the castNum of sprite the clickOn to cn + 1
  237.     else
  238.       set the castNum of sprite the clickOn to cn
  239.     end if
  240.     updateStage()
  241.   end repeat
  242.   set the castNum of sprite the clickOn to cn
  243.   updateStage()
  244.   return rollOver(the clickOn)
  245. end
  246.